const _products = [
  { id: 1, title: 'iPad 4 Mini', price: 500.01, inventory: 2 },
  { id: 2, title: 'iPad 5 Mini', price: 10.09, inventory: 10 },
  { id: 3, title: 'iPad 6 Mini', price: 300.01, inventory: 5 }
]

export const getAllProducts = () => {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve(_products)
    }, 2000)
  })
}

export const bugProduct = (products, success, error) => {
  setTimeout(() => {
    Math.round(Math.random()) ? success() : error()
  })
}
